﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>修改推荐人</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../CSS/bootstrap3.2/css/bootstrap.css" rel="stylesheet">
    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="../../Scripts/avalon.js"></script>
    <script type="text/javascript" src='../../JqueryPlug/lhgdialog/lhgdialog.js?skin=discuz'></script>
    <script src="../../Scripts/B2CCommon.js"></script>

    <script>
        $(document).ready(function () {
            var HYID = ComFunJS.getQueryString("id");
            $(".selTJR").click(function () {
                MyDialog.btviewP('添加机制会员', 'url:Comon/CommonListN.aspx?FormCode=SCYH&ListType=SELECT&QType=allUser', '确认', function () {
                    var selids = this.content.getselids();
                    var selrowdata = this.content.getseldata();
                    $("#conTJR").val(selrowdata[0].UserName).data('data', selrowdata)
                }, 820, 580, frameElement.api);
            })
            $("#addJZHY").click(function () {
                if ($("#conTJR").val() == "") {
                    toastr.warning('请选择推荐人')
                } else {
                    var TJRID, TJRUserName = "";
                    TJRID = $("#conTJR").data('data')[0].ID;
                    TJRUserName = $("#conTJR").data('data')[0].UserName;
                    $.post("DLLAjaxHandler.ashx", { Action: "SaveTJR", HYID: HYID, TJRID: TJRID, TJRUserName: TJRUserName }, function (data) {
                        if (data == "success") {
                            toastr.success("操作成功");
                        }
                    });
                }

            })
        })
    </script>
</head>
<body>
    <div class="container-fluid" style="margin-top: 20px">
        <div class="row">
            <div class="col-xs-6">
                <label>推荐人</label>
                <div class="input-group">
                    <input type="text" class="form-control" id="conTJR" />
                    <span class="input-group-btn">
                        <a href="#" class="btn btn-info selTJR">选择推荐人</a>
                    </span>
                </div>

                <a href="#" class="btn btn-success" style="margin-top: 20px" id="addJZHY">确定修改</a>
            </div>
        </div>

    </div>
    <script src="../../JqueryPlug/Toast/toastr.js"></script>

</body>
</html>
